#ifndef PARAMOBJECT_H
#define PARAMOBJECT_H

#include <QObject>
#include <QString>
#include <QPoint>
#include <QDomComment>
#include <QDebug>

#include "JsonCheck.h"

class ParamObject : public QObject
{
    Q_OBJECT
public:
    explicit ParamObject(QObject *parent = 0){Q_UNUSED(parent)
                                              mIndex = 0;
                                              mStId = 0;
                                              mStIdType = "";
                                              mObjectName = "";
                                              mX = 0;
                                              mY = 0;
                                              mPoint = QPoint(0, 0);
                                              mWidth = 0;
                                              mHeight = 0;
                                              mScale = 1.0;
                                              mShowLeft = false;}

    void        SetIndex(int index){mIndex = index;}
    int         GetIndex() const {return mIndex;}

    void        SetStId(int stId){mStId = stId;}
    int         GetStId() const {return mStId;}

    void        SetStIdType(const QString& rStIdType) {mStIdType = rStIdType;}

    void        SetObjectName(const QString& rObjectName) {mObjectName = rObjectName;}
    QString     GetObjectName() const {return mObjectName;}

    void        SetX(int x){mX = x; mPoint = QPoint(mX, mY);}
    void        SetX(const QString x){mX = x.toInt();}
    int         GetX() const {return (int)(mX*mScale);}

    void        SetY(int y){mY = y; mPoint = QPoint(mX, mY);}
    void        SetY(const QString y){mY = y.toInt();}
    int         GetY() const {return (int)(mY*mScale);}

    void        SetPos(QPoint point){mPoint = point; mX = mPoint.x(); mY = mPoint.y();}
    QPoint      GetPos(){return mPoint;}

    void        SetWidth(int width){mWidth = width;}
    void        SetWidth(const QString width){mWidth = width.toInt();}
    int         GetWidth() const {return (int)(mWidth*mScale);}

    void        SetHeight(int height){mHeight = height;}
    void        SetHeight(const QString height){mHeight = height.toInt();}
    int         GetHeight() const {return (int)(mHeight*mScale);}

    void        SetScale(float scale){mScale = scale;}
    float       GetScale()const {return mScale;}

    void        SetRandom(const QString& random){mRandom = random;}
    QString     GetRandom() const {return mRandom;}

    void        SetName(const QString& name){mName = name;}
    QString     GetName() const {return mName;}

    void        SetShowLeft(const bool showLeft){mShowLeft = showLeft;}
    bool        GetShowLeft() const {return mShowLeft;}

private:

    //显示顺序
    int mIndex;

    int mStId;

    QString mStIdType;

    //控件名字
    QString mObjectName;

    QString mRandom;

    int mX;

    int mY;

    QPoint mPoint;

    int mWidth;

    int mHeight;

    float mScale;

    QString mName;

    //用于非镜像界面中主动调用镜像图片
    bool mShowLeft;
};

#endif // PARAMObject_H
